<!DOCTYPE html>
<html>
<head>
<?php
    $conn = mysql_connect("localhost", "root","123456") or die("Ket noi den MySQL that bai");
    mysql_select_db("mp3", $conn);
    mysql_query("SET NAMES UTF8",$conn);
    $id=$_REQUEST["id"];
    $idcs=$_REQUEST["idcs"];
    $sql = "select * from music where id_music=".$id." and loai = 1";    
    $q = mysql_query($sql);
    $row = mysql_fetch_array($q);
    $tenvideo=$row["tenmusic"];
	 $id_music=$row["id_music"];
?>
<link rel="stylesheet" type="text/css" href="css/chitiet-page-video.css" />
<title><?=$tenvideo?></title>
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="keywords" content="WOW Slider, Wordpress Gallery Slider, Wordpress Photo Slider" />
<meta name="description" content="WOWSlider created with WOW Slider, a free wizard program that helps you easily generate beautiful web slideshow" />
<script language="javascript" type="text/javascript" src="engine1/jquery.js"></script>

</head>
<?php include_once('master_menu.php');?>

<div class="page">
  <div class="musicpage">
        <div class="conten-title" >
         <?php
                $sql = "select * from `music_nghesi`
                inner join `nghesi` on `nghesi`.`id_nghesi`=`music_nghesi`.`id_nghesi` 
                inner join `music` on `music`.`id_music` = `music_nghesi`.`id_music`
                where `music_nghesi`.`id_music`= ".$id." and `music_nghesi`.`id_nghesi`= ".$idcs;
                $q = mysql_query($sql);
                while ($row= mysql_fetch_array($q))
                {
                    $link=$row["link"];
                    $tenvd=$row["tenmusic"];
					$view=$row["view"];
                    $lyric=$row["lyric"];
                    $tencs=$row["nghedanh"];
                    $tenthat=$row["tenthat"];
                    $quoctich=$row["quoctich"];
                    $ngaysinh=$row["ngaysinh"];
                    $id=$row["id_nghesi"];
                    $pic=$row["pic1"];
            ?>
        <h1>
        <?=$tenvd?> </h1>   
         
        <span> - </span>
        <h3><a href="artist_page.php?id=<?=$id?>"><?=$tencs?></a></h3>
       
        </div>
        
        <p class="song-info">
            Sáng tác: <a class="txtBlue" href="#">Tuấn Nguyễn</a> |  Album: <a href="#">Lòng Ðau Tình Phai</a> |  Thể Loại: <a class="txtBlue" title="Xem thể loại Việt Nam" href="#">Việt Nam</a>, <a class="txtBlue" title="Xem th? lo?i Nh?c Tr?" href="">Nhạc trẻ</a> | Lượt nghe: 1.555.902
        </p>
        
        <div class="video-flas">
        <video width="600" height="360" controls autoplay loop>
  <source src="video/<?=$link?>" type="video/mp4">
</video>
	

        </div>
        
        <div class="detail-function">
            <?php
            if(isset($_SESSION["login"])&& $_SESSION["login"]!=NULL)
            {
                echo ("<div id='addlist'>
                    	<div id='icon'></div>
                        <span>Thêm</span>
                    </div>
                    <a id='addlist' href='$link'>
                    	<div id='icon1'></div>
                        <span>Tải Nhạc</span>
                    </a>
                    <p>Click phải chọn save as...</p>");
            }
            ?>
        </div>
        
        <div class="content-block lyric-content">
		<div class="lyric">
		<div>
		
		<h3><?=$tenvd?></h3>
		<p class="_lyricContent">
            
            <?=$lyric?>
            </p>
	</div>
		</div>
		
</div>
        
        <div id="casi">
            <h2 class="content-block-title"><a href="artist_page.php?id=<?=$id?>"><?=$tencs?></a></h2>
            <div class="singer-info-block">
			<a href="#">
			<span class="singer-image"><img width="114px" height="108px;" src="<?=$pic?>"/></span>
			</a>
			<span class="singer-site"><a class="button" href="artist_page.php?id=<?=$idcs?>"><span>Trang cá nhân</span></a></span>
	<p><span>Tên thật:</span> <?=$tenthat?> <br/>
		
        <span>Ngày sinh:</span> <?=$ngaysinh?><br/>
        <span>Quốc gia: </span><?=$quoctich?><br/>

        </p>

	</div>
    		<div class="singer-item singer-album">
	<h2 class="singer-item-title"><a href="artist_page_album.php?id=<?=$idcs?>">Album <?=$tencs?></a></h2>
			
               <?php
    $sql = "select * from album_nghesi  
inner join album on album_nghesi.id_album=album.id_album    
inner join nghesi on album_nghesi.id_nghesi=nghesi.id_nghesi
where nghesi.id_nghesi=".$idcs." limit 3;";
    
    $q = mysql_query($sql);
    
    while ($row= mysql_fetch_array($q))
    {
        $album=$row["id_album"];
        $tenalbum=$row["tenalbum"];
        $view=$row["view"];        
        $pic=$row["pic"];
        $tencs=$row["nghedanh"];
        $id=$row["id_nghesi"];
?> 
         
         
         
         <div class="content-item last-child">
			<a><img width="94" height="94" src="<?=$pic?>"></a>
			<div class="meta">
				<h3><a><?=$tenalbum?></a></h3>
				<span><a><?=$tencs?></a></span>
			</div>
		</div>
	    <?php
    }
    
?>  			
            
            
            
            <div class="clear-fix"></div>
</div>
        </div>
        
        <div class="content-block">
			<p class="content-block-title">Bình luận</p>
         
            
            <div class="comment-form">
            <form action="" method="post">
			<p>
				<textarea class="comment-textarea" name="_txtComment">Hãy chia sẻ cảm nghĩ của bạn về bài hát này.</textarea>
			</p>
			<p class="submit">
        		<button type="submit" name="submit">Bình Luận</button>
    		</p>
            </form>
     	      </div>
            </div>
           
        <div class="comment">
 <?php
     if(isset($_SESSION["login"])&& $_SESSION["login"]!=NULL)
	  {    
		 $user=$_SESSION["login"];
		 $sql="select * from user where username= '".$user."'";
		 $q = mysql_query($sql);
		 $row = mysql_fetch_array($q);
		 $id_user=$row["id_user"];
		 if (isset($_POST["submit"])) 
		 {
			 $com = $_POST["_txtComment"];
			 $str = "call insert_com('".$com."',".$id_music.",".$id_user.")";
			 $r=mysql_query($str);
		  }
	  }
	  else if (isset($_POST["submit"]))
	  {
		  {
			  //echo "<span><a href='../Form/form.php'/>Phải Login</a></span>";
			 header("Location:../form/form.php");
		  }
	  }
       $sql = "select noidung,`comment`.ngaytao as date, music.id_music, user.username as ten, user.pic as avatar from user 
       inner join `comment` on user.id_user=`comment`.id_user 
       inner join music on music.id_music=`comment`.id_music
       where music.id_music = ".$id_music." and loai = 1";
        $q = mysql_query($sql);
        while ($row = mysql_fetch_array($q)) 
        {
             $noidung = $row["noidung"];
			    $date = $row["date"];
			    $pic = $row["avatar"];
             $user_music=$row["ten"];           
            ?> 
            
           
    

       
       <div class="comment2">
                <div class="divimg"><img width="60px" height="60px" src="<?=$pic?>"/></div>
                <span class="icon-com"></span>
                <span class="comment-info">
                <p class="comment-p1"><a href="#"><?=$user_music?></a><span><?=$date?></span></p>
                
                <p class="comment-p2"><?=$noidung?></p>   
                </span>
            </div>     

        

<?php
       }
       }
    mysql_close($conn);
?>   
  </div>
        
        
        
   </div>
   <?php include_once('master_quangcao.php');?>  
  </div>
  
</div>
<?php include_once('master_footer.php');?>